import { useI18n } from '/@/hooks/web/useI18n';
import { BasicColumn, BasicTableProps, FormProps } from '/@/components/Table';
import { findGycsListData } from '/@/api/mes/card/kstMesProCardData';

const { t } = useI18n('sys.empUser');

const modalProps = {
  title: t('工艺参数管理选择'),
};

const searchForm: FormProps = {
  baseColProps: { lg: 6, md: 8 },
  labelWidth: 120,
  schemas: [
    {
      label: t('采集点编号'),
      field: 'tagcode',
      component: 'Input',
    },
    {
      label: t('采集点名称'),
      field: 'tagname',
      component: 'Input',
    },
  ],
};

const tableColumns: BasicColumn[] = [
  {
    title: t('采集点编码'),
    dataIndex: 'tagcode',
    key: 'a.tagcode',
    // sorter: true,
    width: 100,
    slot: 'firstColumn',
  },
  {
    title: t('采集点名称'),
    dataIndex: 'tagname',
    key: 'a.tagname',
    // sorter: true,
    width: 100,
  },
];

const tableProps: BasicTableProps = {
  api: findGycsListData,
  beforeFetch: (params) => {
    console.log(params);
    params['isAll'] = true;
    return params;
  },
  columns: tableColumns,
  formConfig: searchForm,
  rowKey: 'id',
};

// const treeProps: Recordable = {
//   api: officeTreeData,
//   params: { isAll: true },
//   title: t('部门'),
// };

// const treeTableFieldName = 'employee.office.officeCode';

export default {
  modalProps,
  tableProps,
  itemCode: 'id',
  itemName: 'tagcode',
  // treeProps,
  // treeTableFieldName,
};
